package com.dc.ftp.activity.loan;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.dc.ftp.R;
import com.dc.ftp.base.SPBaseActivity;
import com.dc.ftp.utils.PickerViewUtil;

import java.util.ArrayList;

public class WorkInfoActivity extends SPBaseActivity implements View.OnClickListener {

    private EditText etCompanyName;
    private TextView tvCompanyType;
    private TextView tvWorkName;
    private TextView tvStartWorkTime;
    private TextView tvStartCurrentWorkTime;
    private TextView tvCompanyAddress;
    private EditText etCompanyDetailAddress;
    private EditText etCompanyPhone;
    private ArrayList<String> mListCompanyType;
    private ArrayList<String> mListWorkName;
    private View parentView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_work_info);
        super.init();
        setHeadTitle(true,"工作信息");
    }

    @Override
    public void initView() {
         parentView = findViewById(R.id.activity_work_info);

        etCompanyName = (EditText) findViewById(R.id.et_name_company);
         tvCompanyType = (TextView) findViewById(R.id.tv_type_company);
         tvWorkName = (TextView) findViewById(R.id.tv_name_work);
        tvStartWorkTime = (TextView) findViewById(R.id.tv_start_time_work);
        tvStartCurrentWorkTime = (TextView) findViewById(R.id.tv_start_time_current_work);
        tvCompanyAddress = (TextView) findViewById(R.id.tv_address_company);
        etCompanyDetailAddress = (EditText) findViewById(R.id.et_address_company_detail);
        etCompanyPhone = (EditText) findViewById(R.id.et_phone_company);
        

        findViewById(R.id.lly_type_company).setOnClickListener(this);
        findViewById(R.id.lly_name_work).setOnClickListener(this);
        findViewById(R.id.lly_start_time_work).setOnClickListener(this);
        findViewById(R.id.lly_start_time_current_work).setOnClickListener(this);
        findViewById(R.id.lly_address_company).setOnClickListener(this);

    }

    @Override
    public void initData() {

        mListCompanyType = new ArrayList<>();
        mListWorkName = new ArrayList<>();

        mListCompanyType.add("国有单位");
        mListCompanyType.add("机关及事业单位");
        mListCompanyType.add("民营企业");
        mListCompanyType.add("三资企业");
        mListCompanyType.add("其他");

        mListWorkName.add("法人或股东");
        mListWorkName.add("高级管理");
        mListWorkName.add("中级管理");
        mListWorkName.add("初级管理");
        mListWorkName.add("基层员工");
        mListWorkName.add("其他");



    }

    @Override
    public void initEvent() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.lly_type_company:
                PickerViewUtil.initPickerView(this,parentView,true,"选择单位性质",mListCompanyType,tvCompanyType);
                break;
            case R.id.lly_name_work:
                PickerViewUtil.initPickerView(this,parentView,true,"选择工作岗位",mListWorkName,tvWorkName);
                break;
            case R.id.lly_start_time_work:
                PickerViewUtil.initTimePickerView(this,parentView,true,tvStartWorkTime);
                break;
            case R.id.lly_start_time_current_work:
                PickerViewUtil.initTimePickerView(this,parentView,true,tvStartCurrentWorkTime);
                break;
            case R.id.lly_address_company:
                PickerViewUtil.showAddressPickerView(this,parentView,tvCompanyAddress);
                break;
        }

    }
}
